package com.gjy.check.enumtype;

import com.gjy.check.util.CheckUtil;

import java.util.function.Function;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-08-11 10:41:37
 */
public enum Check {

    // 邮箱校验方式
    Email("参数应为Email地址", CheckUtil::isEmail);

    public final String msg;

    // 函数式接口 Object为传入参数类型，Boolean为返回类型
    public final Function<Object, Boolean> function;

    Check(String msg, Function<Object, Boolean> function) {
        this.msg = msg;
        this.function = function;
    }
}
